using System;
using Microsoft.Xna.Framework;

namespace Xfinity.Maths.Filters
{
    public class GaussianFilter:Function1D
    {
        private const float oneOverRootTwoPi = 0.39894228040143267793994605993439f;
        /// <summary>
        /// Evaluates the function at the location.
        /// </summary>
        /// <param name="location">The location.</param>
        /// <returns>The value at the location.</returns>
        public override float Evaluate(float location)
        {
            float value = (float)Math.Pow(MathHelper.E, -(location * location) / 2);
            return oneOverRootTwoPi * value;
        }
    }
}
